<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit">
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" charset="UTF-8" href="/resource/layui/css/layui.css">
<link rel="stylesheet" type="text/css" charset="UTF-8" href="/resource/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" charset="UTF-8" href="/resource/css/common.css">
<link rel="stylesheet" type="text/css" charset="UTF-8" href="/resource/css/gloab.css" />
</head>

<body>
	<div class="" style="margin-left: 15px;">
		<fieldset class="layui-elem-field layui-field-title">
			<legend>订单</legend>
		</fieldset>
		<form class="layui-form layui-form-pane" action="/order/save" id="commonForm">
			<input type="hidden" name="shop_id" value="321312" />
			<div class="layui-form-item">
				<label class="layui-form-label">商品名称</label>
				<div class="layui-input-block">
					<input type="hidden" name="item_id" value="11" />
					<input type="text" name="name" autocomplete="off" placeholder="请输入商品名称" class="layui-input" maxlength="50" value="${m.name }">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">商品数量</label>
				<div class="layui-input-block">
					<input type="number" name="num" autocomplete="off" placeholder="请输入商品数量" class="layui-input" maxlength="50" value="${m.num }">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">商品价格</label>
				<div class="layui-input-block">
					<input type="number" name="price" autocomplete="off" placeholder="请输入商品价格" class="layui-input" maxlength="50" value="${m.price }">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">商品名称</label>
				<div class="layui-input-block">
					<input type="hidden" name="item_id" value="22" />
					<input type="text" name="name" autocomplete="off" placeholder="请输入商品名称" class="layui-input" maxlength="50" value="${m.name }">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">商品数量</label>
				<div class="layui-input-block">
					<input type="number" name="num" autocomplete="off" placeholder="请输入商品数量" class="layui-input" maxlength="50" value="${m.num }">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">商品价格</label>
				<div class="layui-input-block">
					<input type="number" name="price" autocomplete="off" placeholder="请输入商品价格" class="layui-input" maxlength="50" value="${m.price }">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">支付方式</label>
				<div class="layui-input-block">
					<select name="pay_type">
						<option value="">---请选择---</option>
						<option value="1">在线支付</option>
						<option value="2">货到付款</option>
					</select>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">配送费用</label>
				<div class="layui-input-block">
					<input type="number" name="post_fee" autocomplete="off" placeholder="请输入配送费用" class="layui-input" maxlength="50" value="${m.payment }">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">总价</label>
				<div class="layui-input-block">
					<input type="number" name="payment" autocomplete="off" placeholder="请输入商品价格" class="layui-input" maxlength="50" value="${m.payment }">
				</div>
			</div>
			
			<div class="layui-form-item clearfix">
  		  		<div class="xbzx_btn_save_group">
				  <button class="layui-btn save" xbzx-data-type="save" lay-submit="" lay-filter="commonSubmit">保存</button>
				  <a class="layui-btn cancel" href="javascript:;" xbzx-data-type="cancel" lay-filter="">取消</a>
			  	</div>
			</div>
		</form>
	</div>
	<script src="/resource/js/jquery/jquery-1.9.1.js" charset="utf-8" type="text/javascript"></script>
	<script src="/resource/layui/layui.js" charset="utf-8" type="text/javascript"></script>
	<script type="text/javascript">
			window.onload = function() {
			   layui.config({
					base: '/resource/js/xbzx_modules/' //xbzx模块目录
				}).use(['commonsubmit']); 
	
				layui.config({
					base: '/resource/js/xbzx_modules/' //xbzx模块目录
				}).use('xbzx-cms-form'); //加载formJs文件入口
			};
			
			$(function(){
				$('select[name="department"]').val("${m.department}");
				/* 全选 */
				$('#sydepart').click(function(){
					if($(this).attr("checked")=="checked"){
						  $("input:checkbox").attr("checked", true);
					}else{
						  $("input:checkbox").removeAttr("checked");
					}
				});
				var arr = '${m.sydepart}';
				/* 复选框 */
				if(arr.length>0){
					$.each(arr.split(","),function(i,v){
						  $("#sydepartdiv input[value='"+v+"']:checkbox").attr("checked", true);
					});
					
				}
				
				/* 全选 */
				$('#level').click(function(){
					if($(this).attr("checked")=="checked"){
						  $("input:checkbox").attr("checked", true);
					}else{
						  $("input:checkbox").removeAttr("checked");
					}
				});
				var arr = '${m.level}';
				console.log(arr);
				/* 复选框 */
				if(arr.length>0){
					$.each(arr.split(","),function(i,v){
						  $("#leveldiv input[value='"+v+"']:checkbox").attr("checked", true);
					});
					
				}
				
			});
			
		</script>
</body>
</html>
